package com.xayy.health.mgt.controller;

import cn.kawins.base.result.ResultBody;
import com.xayy.health.mgt.model.vo.DataSourceVo;
import com.xayy.health.mgt.service.DataQualityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangxa
 */
@RestController
@RequestMapping(value = "/data-service")
@Api(tags = "质量分析")
public class DataQualityController {

    @Autowired
    private DataQualityService dataQualityService;


    /**
     * 执行sql指定数据源
     *
     * @param dataSourceVo sql入参
     * @return ResultBody
     */
    @ApiOperation(value = "执行sql指定数据源")
    @PostMapping("/excuteRunSql")
    public ResultBody excuteRunSql(@RequestBody DataSourceVo dataSourceVo) {
        return ResultBody.success(dataQualityService.excuteRunSql(dataSourceVo));
    }

}
